﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Login.aspx.vb" Inherits="SIAVU.Login"
    Title="SIAVU - Login" %>

<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxMenu" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>

<script type="text/javascript" src="../Funciones.js"></script>

<body style="height: 100%; width: 100%;">
    <form id="form1" runat="server" style="height: 100%; width: 100%; vertical-align: bottom;">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <script language="javascript" type="text/javascript">
        function ingresarSistema() {
            var claveHidden = document.getElementById('<%=contrasenaEncriptada.ClientID %>');
            var claveText = document.getElementById('<%=contrasena.ClientID %>');
            claveHidden.value = hex_sha1(claveText.value);
            claveText.value = '';
//            pcLogin_legajo_Raw.focus();            
    }
    </script>

    <asp:HiddenField ID="contrasenaEncriptada" runat="server" />
    <dx:ASPxPopupControl ID="pcLogin" runat="server" AllowDragging="True" HeaderText="Bienvenidos a SIAVU"
        ShowOnPageLoad="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
        Modal="True" CloseAction="None" CssFilePath="~/App_Themes/Youthful/{0}/styles.css"
        CssPostfix="Youthful" SpriteCssFilePath="~/App_Themes/Youthful/{0}/sprite.css"
        ShowCloseButton="False" Width="275px" Style="width: 275px">
        <ModalBackgroundStyle BackColor="#BAC6D1">
            <BackgroundImage HorizontalPosition="center" ImageUrl="~/Imagenes/FondoLogin.jpg"
                Repeat="NoRepeat" VerticalPosition="center" />
        </ModalBackgroundStyle>
        <%--                            <ClientSideEvents PopUp="function(s, e) {
                                pcLogin_legajo_Raw.focus();
                                }" />--%>
        <ContentCollection>
            <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
                <asp:UpdatePanel ID="upLogin" runat="server">
                    <ContentTemplate>
                        <table cellpadding="0" cellspacing="0" align="center" style="width: 100%;">
                            <tr align="center">
                                <td align="center">
                                    <asp:Panel ID="pnlIngresar" runat="server" Width="100%" Visible="true" DefaultButton="btnIniciarSesion">
                                        <table width="100%" border="0" cellpadding="5" cellspacing="0" align="center">
                                            <tr>
                                                <td align="left" width="30%">
                                                    <b>Legajo</b>
                                                </td>
                                                <td align="left" width="70%">
                                                    <dx:ASPxTextBox ID="legajo" runat="server" Size="20">
                                                        <MaskSettings Mask="&lt;0..1000000&gt;" ShowHints="False" IncludeLiterals="All" ErrorText='""' />
                                                    </dx:ASPxTextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="30%">
                                                    <b>Clave</b>
                                                </td>
                                                <td width="70%">
                                                    <asp:TextBox ID="contrasena" runat="server" TextMode="Password" autocomplete="off"
                                                        AutoPostBack="false" Width="58%"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:CustomValidator ID="cvUsuario" runat="server" Display="Dynamic" ErrorMessage="Definido en el código"
                                                        Text="Definido en el código" Font-Size="Small" Font-Names="Calibri"></asp:CustomValidator>
                                                    <br />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" align="center">
                                                    <dx:ASPxButton ID="btnIniciarSesion" runat="server" Text="Iniciar Sesión" ClientSideEvents-Click="function(s, e) { ingresarSistema(); }"
                                                        CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue"
                                                        SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                                        <ClientSideEvents Click="function(s, e) { ingresarSistema(); }" />
                                                    </dx:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnIniciarSesion" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                <asp:UpdateProgress ID="uproLogin" runat="server">
                    <ProgressTemplate>
                        <div>
                            <img src="../Imagenes/Progreso.gif" alt="" />
                            <asp:Label ID="lLogininiciando" runat="server" Text="Iniciando Sesión..." Font-Bold="True"
                                Font-Names="Calibri" Font-Size="Small" ForeColor="#006600"></asp:Label>
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </dx:PopupControlContentControl>
        </ContentCollection>
        <HeaderStyle Font-Bold="True" Font-Size="Medium" Font-Strikeout="False" ForeColor="#4D80B7">
            <BackgroundImage ImageUrl="~/App_Themes/Youthful/Web/pcHeaderBack.gif" Repeat="RepeatX" />
        </HeaderStyle>
    </dx:ASPxPopupControl>
    </form>
</body>
